<?php
class FckHelper extends AppHelper{
	var $helpers = Array('Html', 'Javascript');
	function load($id,$height=null) {
		$did = '';
		foreach (explode('.', $id) as $v) {
		$did .= ucfirst($v);
		} 
		$dan ='"';
		$code="var editor = K.create('textarea[id=".$dan.$did.$dan."]', {
				uploadJson : '../js/kindeditor/php/upload_json.php',
				fileManagerJson : '../js/kindeditor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=webpage]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=webpage]')[0].submit();
					});
				}
			});\n";
		return $code; 
	}
}

?>